package salomon.utils 
{
	import flash.external.ExternalInterface;
	import flash.net.navigateToURL;
	import flash.net.URLRequest;
	import salomon.type.AlertType;
	/**
	 * ...
	 * @author Tiago Salomon
	 */
	public class Alert 
	{
		/**
		 * Dispatch the console of browser.
		 * @param	obj
		 * @param	type	AlertType.CONSOLE or AlertType.ALERT
		 */
		public static function to(obj:*, type:String = "alert-console"):void 
		{
			if (type == AlertType.ALERT)
			{
				if (ExternalInterface.available)
				{
					ExternalInterface.call("alert", obj);
				}
			}
			else
			{
				if (ExternalInterface.available)
				{
					ExternalInterface.call("console.log", obj);
				}
			}
			
			trace(obj);
		}
		
	}

}